package com.xajava.controller;

import com.xajava.entity.Resp;
import com.xajava.entity.User;
import com.xajava.services.UserServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class UserController {


    @Autowired
    private UserServices userServices;


    @GetMapping("/findAll")
    public Resp<Object> findAll(){
        List<User> users = userServices.findAll();
        return new Resp().success(users);
    }

}
